import hex from 'hex-string';

export default class Bin2Hex {

  static Encoder = class Encoder {
    static Name = "Bin2Hex <%= UIText.encode %>";

    compute(data) {
      return hex.encode(data);
    }
  }

  static Decoder = class Decoder {
    static Name = "Bin2Hex <%= UIText.decode %>";

    compute(text) {
      let data = hex.decode(text.toLowerCase());
      return new Buffer(data);
    }
  }
}
